package com.dtzhejiang.social.supervision.risk.engine.core.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.interceptor.DefaultTransactionAttribute;
import org.springframework.transaction.interceptor.TransactionAttribute;

/**
 * @Author: Lexus
 * @Date: 2020/12/23 15:34
 */
@Configuration
public class JobConfiguration {

    @Bean
    TransactionAttribute noTransactionAttribute(){
        DefaultTransactionAttribute attribute = new DefaultTransactionAttribute();
        attribute.setPropagationBehavior(Propagation.NEVER.value());
        attribute.setIsolationLevel(Isolation.DEFAULT.value());
        attribute.setTimeout(30);
        return attribute;
    }
}
